function imageCode(cache) {
  let code = '';
  switch (cache.subType) {
    case 'Image':
      code = assetImageCode(cache);
      break;
    case 'FLImage':
      code = flimageCode(cache);
      break;
    case 'CachedNetworkImage':
      code = cachednetworkimageCode(cache);
      break;
    default:
      code = flimageCode(cache);
      break;
  }

  return code;
}

function assetImageCode(cache) {
  let data = cache.data;
  console.log(data.id);
  const code = `Image.asset('need url',
    width: ${unit(data.width)},
    height: ${unit(data.height)},
  )`;

  return code;
}

function flimageCode(cache) {
  let data = cache.data;
  console.log(data.id);
  const code = `FLImage.asset('${data.name.replace(/'/g, '')}',
    width: ${unit(data.width)},
    height: ${unit(data.height)},
  )`;

  return code;
}

function cachednetworkimageCode(cache) {
  let data = cache.data;
  console.log(data.id);
  const code = `CachedNetworkImage(
    imageUrl: 'need url',
    width: ${unit(data.width)},
    height: ${unit(data.height)},
  )`;
  return code;
}